@using Variant = MudBlazor.Variant
@inherits StudioComponentBase
@using Elsa.Studio.Workflows.Services
@inject ILocalizer Localizer

<MudDialog>
    <DialogContent>
        <EditForm EditContext="_editContext" OnValidSubmit="OnValidSubmit">
            <FluentValidationValidator @ref="_fluentValidationValidator" Validator="_validator" DisableAssemblyScanning="true"/>
            <MudStack>
                <MudTextField Label="@Localizer["Name"]" @bind-Value="_metadataModel.Name" For="@(() => _metadataModel.Name)" HelperText="@Localizer["The name of the new workflow."]" Variant="Variant.Outlined" Margin="Margin.Dense" />
                <MudTextField Label="@Localizer["Description"]" @bind-Value="_metadataModel.Description" For="@(() => _metadataModel.Description)" HelperText="@Localizer["A brief description of the workflow."]" Lines="3" Variant="Variant.Outlined" Margin="Margin.Dense" />
            </MudStack>
        </EditForm>
    </DialogContent>
    <DialogActions>
        <MudButton OnClick="OnCancelClicked">@Localizer["Cancel"]</MudButton>
        <MudButton Color="Color.Primary" OnClick="OnSubmitClicked">@Localizer["Ok"]</MudButton>
    </DialogActions>
</MudDialog>